﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmModificarCliente.aspx.cs" Inherits="Farmacia.net.Ventas.Cliente.frmModificarCliente" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <asp:Label ID="Label1" runat="server" Text="Ingrese RUC o DNI:"></asp:Label> 
        &nbsp; 
        <asp:TextBox ID="txtBuscar" runat="server"></asp:TextBox>
        &nbsp;
        <asp:Button ID="btnBuscar" runat="server" Text="Buscar" />
    </fieldset>

<fieldset>
    <legend> <b>Modificar Cliente </b></legend>

    <asp:FormView ID="fvEditar" runat="server" BackColor="#CCCCCC" 
        BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" 
        CellSpacing="2" DataSourceID="odsModificarCliente" ForeColor="Black" 
        GridLines="Both" DefaultMode="Edit">
        <EditItemTemplate>
            <table class="style1">
                <tr>
                    <td>
                        IdCliente:</td>
                    <td>
                        <asp:TextBox ID="IdClienteTextBox" runat="server" 
                            Text='<%# Bind("IdCliente") %>' Width="100px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        RucDni:</td>
                    <td>
                        <asp:TextBox ID="RucDniTextBox" runat="server" Text='<%# Bind("RucDni") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        RazonSocial:
                    </td>
                    <td>
                        <asp:TextBox ID="RazonSocialTextBox" runat="server" 
                            Text='<%# Bind("RazonSocial") %>' Width="300px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Direccion:</td>
                    <td>
                        <asp:TextBox ID="DireccionTextBox" runat="server" 
                            Text='<%# Bind("Direccion") %>' Width="300px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Actualizar" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                    </td>
                </tr>
            </table>
        </EditItemTemplate>
        <EditRowStyle BackColor="#066000" Font-Bold="True" ForeColor="White" />
        <FooterStyle BackColor="#cccccc" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        
        <InsertItemTemplate>
            IdCliente:
            <asp:TextBox ID="IdClienteTextBox" runat="server" 
                Text='<%# Bind("IdCliente") %>' />
            <br />
            RucDni:
            <asp:TextBox ID="RucDniTextBox" runat="server" Text='<%# Bind("RucDni") %>' />
            <br />
            RazonSocial:
            <asp:TextBox ID="RazonSocialTextBox" runat="server" 
                Text='<%# Bind("RazonSocial") %>' />
            <br />
            Direccion:
            <asp:TextBox ID="DireccionTextBox" runat="server" 
                Text='<%# Bind("Direccion") %>' />
            <br />
            Cotizacion:
            <asp:TextBox ID="CotizacionTextBox" runat="server" 
                Text='<%# Bind("Cotizacion") %>' />
            <br />
            Pedido:
            <asp:TextBox ID="PedidoTextBox" runat="server" Text='<%# Bind("Pedido") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insertar" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
        </InsertItemTemplate>
        <ItemTemplate>
            IdCliente:
            <asp:Label ID="IdClienteLabel" runat="server" Text='<%# Bind("IdCliente") %>' />
            <br />
            RucDni:
            <asp:Label ID="RucDniLabel" runat="server" Text='<%# Bind("RucDni") %>' />
            <br />
            RazonSocial:
            <asp:Label ID="RazonSocialLabel" runat="server" 
                Text='<%# Bind("RazonSocial") %>' />
            <br />
            Direccion:
            <asp:Label ID="DireccionLabel" runat="server" Text='<%# Bind("Direccion") %>' />
            <br />
            Cotizacion:
            <asp:Label ID="CotizacionLabel" runat="server" 
                Text='<%# Bind("Cotizacion") %>' />
            <br />
            Pedido:
            <asp:Label ID="PedidoLabel" runat="server" Text='<%# Bind("Pedido") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Editar" />
        </ItemTemplate>
        <PagerStyle BackColor="#5CCCCC" ForeColor="Black" HorizontalAlign="Left" />
        <RowStyle BackColor="White" />
    </asp:FormView>

    <asp:ObjectDataSource ID="odsModificarCliente" runat="server" 
        DataObjectTypeName="Farmacia.Entities.Cliente" 
        onobjectcreating="odsNuevoCliente_ObjectCreating" 
        SelectMethod="GetFromClienteByRucDni" 
        TypeName="Farmacia.BussinessLogic.ClienteBL" 
        UpdateMethod="RegistrarCliente">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtBuscar" Name="rucDni" PropertyName="Text" 
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

</fieldset>

</asp:Content>
